#include<stdio.h>

int HowInNum(int n,int m){
	int count=0;
	while(n!=0){
		if(n%10==m){
			count++;
		}
		n=int(n/10);
	}
	return count;
} 

int HowInPageNum(int x,int y){
	int count2=0;
	while(x!=0){
		count2+=HowInNum(x,y);
		x--;
	}
	return count2;
}

int main(){
	int s;
	scanf("%d",&s);
	int c=0;
	for(int w=0;w<10;w++){
		printf("%d ",c);
		printf("%4d",HowInPageNum(s,c));
		printf("\n");
		c++;
	}
}
